GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 84a66e...a6029b )
by Benjamin
01:37
created

stateGetter.js ➔ ... ➔ ???   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
nc 1
dl 0
loc 1
rs 10
nop 1
1
/*
2
* central function to retrieve state from reducer
3
* used inside of mapStateToProps by grid and other plugins
4
* @returns {object} state
5
6
* will not return immutable object, only plain JS object
7
8
* if a dynamic reducerKey is passed, it will favor that key
9
* over the build in grid keys
10
11
*/
12
13
export const stateGetter = (state, props, key, entry) => {
14
15
    if (props
16
        && props.reducerKeys
17
        && Object.keys(props.reducerKeys).length > 0
18
        && props.reducerKeys[key]) {
19
20
        const dynamicKey = props.reducerKeys[key];
21
        const dynamicState = get(state, dynamicKey, entry);
22
23
        return dynamicState && dynamicState.toJS
24
            ? dynamicState.toJS()
25
            : dynamicState;
26
    }
27
28
    const val = get(state, key, entry);
29
30
    if (val) {
31
        return val.toJS ? val.toJS() : val;
32
    }
33
34
    return null;
35
};
36
37
export const get = (state, key, entry) => state
38
    && state[key]
39
    && state[key].get
40
    && state[key].get(entry)
41
        ? state[key].get(entry)
42
        : null;
43